class newNode {
    constructor(val = -1, next = null) {
        this.val = val;
        this.next = next;

    }
}

class linkQueen {
    constructor() {
        let u = new newNode();
        this.head = u;
        this.tail = u;
        this.size = 0;
    }

    push(val) {
        this.size++;
        this.tail.next = new newNode(val);
        this.tail = this.tail.next;

    }
    size() {
        return this.size;
    }

    pop() {
        if (!this.size()) return
        this.head = this.head.next;
    }

    empty() {
        return this.sz <= 0
    }

    tostring() {
        if (this.empty()) return
        this.temp = this.head.next;
        while (this.temp != this.tail.next) {
            console.log(this.temp);
            this.temp = this.temp.next;
        }
    }
}


let q = new linkQueen()
q.push(10);
q.push('wsw');
q.tostring();
